export function formateDate(date) {
  const dateObj = new Date(date)
  const year = dateObj.getFullYear()
  const month = dateObj.getMonth() + 1 < 10 ? '0' + (dateObj.getMonth() + 1) : dateObj.getMonth() + 1
  const day = dateObj.getDate() < 10? '0' + dateObj.getDate() : dateObj.getDate()
  return [year, month, day]
}
export function formateWeek(date) {
  const dateObj = new Date(date)
  switch (dateObj.getDay()) {
    case 0:
      return "天"
    case 1:
      return "一"
    case 2:
      return "二"
    case 3:
      return "三"
    case 4:
      return "四"
    case 5:
      return "五"
    case 6:
      return "六"
  
    default:
      break;
  }
}

export function formateDays(startDate, endDate) {
  return (new Date(startDate) - new Date(endDate)) / 86400000
}